package com.zzsy.shoppingpro.user.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.zzsy.shoppingpro.home.acitivty.HomeActivity;
import com.zzsy.shoppingpro.utils.SPHelper;

public class StartActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        startApp();
    }


    private void startApp() {
        Object result = SPHelper.getSimpleParam(StartActivity.this, "not_first_entry_app", false);
        if((boolean) result){
            //不是第一次启动APP
            startActivity(new Intent(StartActivity.this, HomeActivity.class));
        }else{
            //是第一次启动APP 所以进入欢迎界面
            startActivity(new Intent(StartActivity.this,WelcomeActivity.class));
            SPHelper.setSimpleKeyValue(StartActivity.this,"not_first_entry_app",true);
        }
        finish();
    }
}
